package com.fizz.redpacket.algorithm;

public class AllocateStrategyFactory {
        static volatile AllocateStrategy strategy;
            public static AllocateStrategy getStrategy() {
                if (strategy == null) {
                    synchronized (AllocateStrategy.class) {
         if (strategy == null) {
           strategy = (AllocateStrategy)new MyAllocateStrategy();
         }
       }
     }
     return strategy;
            }
}
